new Vue({
    el:"#app",
    data:{
        message:'...'
    },
    mounted(){
        axios
            .get('json/new.json')
            .then(response => (this.message = response.data.url))
    .catch(function (error){
            console.log(error);
        })
    }
})






//返回顶部效果
var t = document.querySelector("#toTop");
window.onscroll = function () {
    console.log(document.documentElement.scrollTop > 500 || document.body.scrollTop > 500);
    if (document.documentElement.scrollTop > 500 || document.body.scrollTop > 500){
        t.style.display = "block";
    }else {
        t.style.display = "none";
    }
}

//点击返回顶部

t.addEventListener( 'click',function () {
    //让  dcrollto 支持平滑滚动
    window.scrollTo({
        top:0,
        behavior:'smooth'
    })
});



var rows = document.querySelectorAll("#qii  li");
var nr = document.querySelectorAll(".nr>div");

for(var i=0;i<rows.length;i++){
    rows[i].index = i;
    rows[i].addEventListener('mouseover',function () {
        for (var k=0;k<rows.length;k++){
            rows[k].classList.remove('active');
            nr[k].classList.remove('active');
        }
        this.classList.add('active');
        console.log(this.index);
        nr[this.index].classList.add('active');
    })
}


